<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>
<head>
    <!-- Required meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <title>Hello, world!</title>
    <%--<script src="js/showCustomerInf.js"></script>--%>
    <%--<script src="js/pages.js"></script>--%>
    <script src="js/pages.js"></script>
</head>
<body onload="ShowCustomerInf()">
<nav class="navbar navbar-expand-lg " style="background-color: aquamarine;">
    <a class="navbar-brand" href="/homePage">主页</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" href="/ClassifyBooks">书籍分类 <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/myCart">购物车</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                   data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">
                    设置
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="/showProfile">个人资料</a>
                    <a class="dropdown-item" href="#">消息</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="/changePwdInput">更改密码</a>
                </div>
            </li>
            <%--<li class="nav-item">
                <a class="nav-link" href="#">登录</a>
            </li>--%>
            <li class="nav-item">
                <a class="nav-link" href="/exit" id="exit" style="display: none" onclick="delCookie()">退出登录</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/loginInput" id="register">登录</a>
            </li>
            <li class="nav-item">
                <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">联系我们</a>
            </li>
        </ul>
        <form class="form-inline my-2 my-lg-0" action="/searchBook">
            <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
        </form>
    </div>
</nav>
<%--<script>
    window.onload=function (ev) {
        var cookies = document.cookie;
        var list = cookies.split("; ");          // 解析出名/值对列表
        for(var i = 0; i < list.length; i++) {
            var arr = list[i].split("=");          // 解析出名和值
            if(arr[0]==='username'){
                console.log(decodeURIComponent(arr[1])) ;   // 对cookie值解码
                document.getElementById("register").innerText=decodeURIComponent(arr[1])+'已登录';
            }
        }
    }
</script>--%>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>